package com.syh.core.ddd.domain;

import lombok.Data;
import lombok.EqualsAndHashCode;

import java.io.Serializable;
import java.util.UUID;

@Data
@EqualsAndHashCode(callSuper = true)
public abstract class AbstractSimpleAggregate<ID extends Serializable> extends AbstractAggregate<ID> {

  protected Long createTimeStamp;
  protected Long lastUpdateTimeStamp;

  protected AbstractSimpleAggregate() {
    this.createTimeStamp = System.currentTimeMillis();
  }

  /**
   * 初始化uuid 创建时间戳
   */
  protected void initDefault() {
    this.createTimeStamp = System.currentTimeMillis();
    this.uuid = UUID.randomUUID().toString();
  }


}
